package com.sdu.cloudservice.entity;

import java.io.Serializable;
import java.util.Date;

public class UserEntity implements Serializable {
    private String username;

    private String password;

    private Date registerDate;

    private Date lastLogin;

    private Integer picDownload;

    private Integer excelDownload;

    private Integer queryTimes;

    private static final long serialVersionUID = 1L;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Date getLastLogin() {
        return lastLogin;
    }

    public void setLastLogin(Date lastLogin) {
        this.lastLogin = lastLogin;
    }

    public Integer getPicDownload() {
        return picDownload;
    }

    public void setPicDownload(Integer picDownload) {
        this.picDownload = picDownload;
    }

    public Integer getExcelDownload() {
        return excelDownload;
    }

    public void setExcelDownload(Integer excelDownload) {
        this.excelDownload = excelDownload;
    }

    public Integer getQueryTimes() {
        return queryTimes;
    }

    public void setQueryTimes(Integer queryTimes) {
        this.queryTimes = queryTimes;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserEntity other = (UserEntity) that;
        return (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getRegisterDate() == null ? other.getRegisterDate() == null : this.getRegisterDate().equals(other.getRegisterDate()))
            && (this.getLastLogin() == null ? other.getLastLogin() == null : this.getLastLogin().equals(other.getLastLogin()))
            && (this.getPicDownload() == null ? other.getPicDownload() == null : this.getPicDownload().equals(other.getPicDownload()))
            && (this.getExcelDownload() == null ? other.getExcelDownload() == null : this.getExcelDownload().equals(other.getExcelDownload()))
            && (this.getQueryTimes() == null ? other.getQueryTimes() == null : this.getQueryTimes().equals(other.getQueryTimes()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getRegisterDate() == null) ? 0 : getRegisterDate().hashCode());
        result = prime * result + ((getLastLogin() == null) ? 0 : getLastLogin().hashCode());
        result = prime * result + ((getPicDownload() == null) ? 0 : getPicDownload().hashCode());
        result = prime * result + ((getExcelDownload() == null) ? 0 : getExcelDownload().hashCode());
        result = prime * result + ((getQueryTimes() == null) ? 0 : getQueryTimes().hashCode());
        return result;
    }
}